Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Path Traversal vulnerability#24

Open
bitcoiner-dev wants to merge 1 commit intomasterfrom
sentinel-fix-path-traversal-7150576098070390315
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Path Traversal vulnerability#24
bitcoiner-dev wants to merge 1 commit intomasterfrom
sentinel-fix-path-traversal-7150576098070390315

Conversation

@bitcoiner-dev
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: A path traversal vulnerability existed where unvalidated user input (config.profile and name in snapshot commands) was directly concatenated into file paths (e.g., snapshots/{name}.json), allowing the use of relative path components like ../ to access or overwrite arbitrary files outside the intended directories.
🎯 Impact: An attacker or malicious input could bypass directory sandbox restrictions, leading to critical wallet data exposure, state corruption, or arbitrary file overwrites.
πŸ”§ Fix: Implemented crate::utils::validate_file_name which enforces strict input validation, exclusively allowing ASCII alphanumeric characters, underscores, and dashes. Integrated this check into profile_path, snapshot_dir in src/paths.rs, and the Save and Restore snapshot actions in src/commands/snapshot.rs.
βœ… Verification: cargo test confirms the changes don't break existing functionality, and manual code review ensures no path-related logic operates on invalid user data.


PR created automatically by Jules for task 7150576098070390315 started by @bitcoiner-dev

…mmands

Adds a strict `validate_file_name` function to sanitize user input (profile and snapshot names) before constructing file paths, preventing arbitrary directory access.

Co-authored-by: bitcoiner-dev <75873427+bitcoiner-dev@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant